import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/login/index.vue'
import HomeView from '@/views/home/index.vue'
import FenView from '@/views/fen/index.vue'
import MyView from '@/views/my/index.vue'
import XqView from '@/views/xq/index.vue'
import Index1View from '@/views/home/index1.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 重定向
    { path: '/', redirect: '/home' },
    {
      path: '/login',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: 'index1',
          name: 'index1',
          component: Index1View,
        }
      ]
    },
    {
      path: '/fen',
      name: 'fen',
      component: FenView,
    },
    {
      path: '/my',
      name: 'my',
      component: MyView,
    },
    {
      path: '/xq',
      name: 'xq',
      component: XqView,
    },
  ],
})

export default router
